package com.zmn.oms.zmn.normal.business.interfaces.order;

import com.zmn.oms.common.dio.normal.master.UpdateAddressDIO;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.bo.order.OrderBO;
import com.zmn.oms.model.dto.order.OrderReworkDTO;
import com.zmn.oms.model.dto.order.zmn.ZsNormalAddressOrderDTO;
import com.zmn.oms.model.dto.order.zmn.ZsNormalNewOrderDTO;
import com.zmn.oms.model.dto.order.zmn.ZsNormalUpdateOrderDTO;
import com.zmn.oms.model.dto.work.modify.CheckReworkOrderDTO;
import com.zmn.oms.model.dto.work.modify.DuplicateOrderDTO;
import com.zmn.oms.model.dto.work.modify.other.ZsPartReimburseGroupDTO;
import com.zmn.oms.model.dto.work.modify.other.ZsRemarkDTO;
import com.zmn.oms.model.entity.part.OrderPart;
import com.zmn.oms.model.entity.work.OrderWork;

import java.util.List;

/**
 * 类描述：啄木鸟普通单
 *
 * @author lujia
 * @date 2018/11/21 16:56
 */
public interface ZsNormalOrderBService {

    /**
     * 返修单检查
     *
     * @param checkReworkOrderDTO
     * @throws OmsBaseException
     */
    OrderReworkDTO checkReworkId(CheckReworkOrderDTO checkReworkOrderDTO) throws OmsBaseException;

    /**
     * 系统自动报销
     * @param orderId
     * @param workId
     */
	void saveSysPartReimburse(Long orderId, Long workId, List<OrderPart> partList) throws OmsBaseException;

	/**
     * 保存配件报销信息
     *
     * @param zsPartReimburseGroupDTO
     */
    void savePartReimburse(ZsPartReimburseGroupDTO zsPartReimburseGroupDTO) throws OmsBaseException;

    /**
     * 发送erp配件结算
     * @param orderWork
     * @param partReimburseGroupDTO
     * @param orderParts
     */
    void sendPartReimburseInfoToERP(OrderWork dbOrderWork, OrderWork orderWork, ZsPartReimburseGroupDTO partReimburseGroupDTO, List<OrderPart> orderParts);
    /**
     * 保存工单内部备注
     *
     * @param dto
     */
    void saveWorkRemark(ZsRemarkDTO dto);

    /**
     * 保存工单商家备注
     *
     * @param dto
     */
    void saveFactoryRemark(ZsRemarkDTO dto);

    /**
     * 保存工单工程师备注
     *
     * @param dto
     */
    void saveMasterRemark(ZsRemarkDTO dto);


    /**
     * 保存服务商备注
     * @param dto
     */
    void saveServiceProviderRemark(ZsRemarkDTO dto);

    /**
     * 订单确认
     *
     * @param zsNormalUpdateOrderDTO
     * @throws OmsBaseException
     */
    void saveConfirmOrder(ZsNormalUpdateOrderDTO zsNormalUpdateOrderDTO) throws OmsBaseException;

    /**
     * 修改订单
     *
     * @param updateOrderDTO
     */
    void updateOrder(ZsNormalUpdateOrderDTO updateOrderDTO) throws OmsBaseException;

    /**
     * 新增订单
     *
     * @param newOrderDTO 订单
     * @return
     * @throws Exception
     */
    OrderBO insertOrder(ZsNormalNewOrderDTO newOrderDTO) throws OmsBaseException;

    /**
     * 新增渠道订单
     *
     * @param newOrderDTO 订单
     * @return
     * @throws Exception
     */
    OrderBO insertChannelOrder(ZsNormalNewOrderDTO newOrderDTO) throws OmsBaseException;

    /**
     * 修改地址
     *
     * @param addressOrderDTO
     */
    void updateAddress(ZsNormalAddressOrderDTO addressOrderDTO) throws OmsBaseException;

    /**
     * 修改地址
     *
     * @param addressOrderDTO
     */
    void modifyAddress(UpdateAddressDIO updateAddressDIO) throws OmsBaseException;

    /**
     * 是否不予报销
     * @param orderWork
     * @return
     * @throws OmsBaseException
     */
    boolean isNoReimbursement(OrderWork orderWork) throws OmsBaseException;
}
